import { World } from "../World/World";
import { compatibilityCheck } from "../World/utils/compatibility";

function main() {
  try {
    // 获取容器
    const container = document.querySelector("#scene-container");
    if (container === null) {
      throw Error("The container is null");
    }
    if (!compatibilityCheck(container)) {
      throw Error("The current browser is not compatible.");
    }
    // 创建一个world类实例
    const world = new World(container);
    // 开始动画循环
    world.start();
  } catch (error) {
    console.log(error);
  }
}

main();
